using Moq;
using NUnit.Framework;
using Tycho.Parser.Peg;

namespace Tycho.Parser.Tests.Peg {
    [TestFixture]
    public class KeywordRuleSpecification {
        [Test]
        public void ShouldUseSpecialKeywordBuilderToBuildProduction () {
            var builder = new Mock<ISpecialKeywordBuilder> ();
            var production = new Mock<IProduction> ().Object;
            builder.Setup (b => b.Build ("keyword")).Returns (production);
            var keyword = new KeywordRule ("keyword", builder.Object);
            Assert.That (keyword.Production, Is.SameAs (production));
        }
    }
}